/*********************************** (C) COPYRIGHT ******************************
 * address: https://gitee.com/liuniansihuo/multitasks-os
 *
 * Change Logs:
 * Date			Author      	Notes
 * 2019-06-26	LiuHuo			first version
 *
 * Modify Note:By default, zhe system tick is 1ms ,Don't consider Time overflows For the time being,
 *  2^32 ms = 1193.046h = 49.7 day . when app continue working more than 49.7 days,that must be consider
*******************************************************************************/
#ifndef __os_tick_H_
#define __os_tick_H_





#define t1ms	(1)
#define t10ms	(10)
#define t20ms	(20)
#define t30ms	(30)
#define t40ms	(40)
#define t50ms	(50)
#define t60ms	(60)
#define t70ms	(70)




#define t500ms	(500)
#define t800ms	(800)
#define t850ms	(800)

#define t1s		(1000)

#define T1ms 	(1)
#define Tnms(t)	(t)                     //毫秒
#define Tns(t)	((t)*Tnms(1000))        //秒
#define Tnm(t)  ((t)*Tnms(60*1000))     //分
#define Tnh(t)  ((t)*Tnms(60*60*1000))  //时

enum
{
	SYSCLK_FRE,
	HCLK_FRE,
	PCLK1_FRE,
	PCLK2_FRE,
	ADCCLK_FRE,
};

u32 system_clock_fre_get(u8 type);
void systick_compensation(u32 time);
SysTick_t systick_get_currTime(void);
void systick_init(void);
u32 systick_get_time_difference(SysTick_t Time);
u8 systick_get_difference_assign(SysTick_t *Time,u32 diff);

SysTick_t sys_timestamp_get(void);
void sys_timestamp_set(SysTick_t T);
SysTick_t sys_timestamp_msec_get(void);

void delay_us(u32 us);
void delay_ms(u32 ms);


#endif
